package copy.tools;

public class StringStrTools {
    /**
     * 拼接字符串
     * @param start 开始下标
     * @param end 结束下标
     * @param chars 数据源
     * @return
     */
    public static String appendFromStartToEnd(int start,int end,char[] chars){
        String msg = "";
        for (int i = start; i <= end; i++) {
            msg += chars[i];
        }
        return msg;
    }


    public static final String GET = "get";
    public static final String SET = "set";
    public static String genStr(String str,String name){
        return str + name.substring(0,1).toUpperCase()+name.substring(1);
    }

    /**
     * 包名.类名.class --> 类名
     * @return
     */
    public static String getSimleNameByClassName(String typeTransformClassName){
        typeTransformClassName= typeTransformClassName.substring( 0,typeTransformClassName.lastIndexOf(".") );//全限定类名->去除.class后缀
        typeTransformClassName = typeTransformClassName.substring(typeTransformClassName.lastIndexOf(".")+1);//全限定类名 -> 去除包名
        return typeTransformClassName;
    }
}
